home *** CD-ROM | disk | FTP | other *** search
- global gBigBalloon, gBDropSprite, gBalloons, gBalloonsList, gReturnFrame, gUserLevel
-
- on demoCursor
- set userH to the mouseH
- set userV to the mouseV
- if the frame > label("Tangram 3") then
- set newLoc to point(91, 187)
- else
- if the frame > label("Tangram 2") then
- set newLoc to point(123, 154)
- else
- if the frame > label("Tangram 1") then
- set newLoc to point(115, 268)
- else
- exit
- end if
- end if
- end if
- cursor(200)
- set cursorSprite to 37
- set origLoc to point(userH, userV)
- set the loc of sprite cursorSprite to origLoc
- updateStage()
- slidePiece(cursorSprite, origLoc, newLoc, 25)
- puppetSprite(cursorSprite, 0)
- go(the frame + 1)
- end
-
- on returnCursor
- set userH to the mouseH
- set userV to the mouseV
- set cursorSprite to 37
- set origLoc to the loc of sprite cursorSprite
- set newLoc to point(userH, userV)
- slidePiece(cursorSprite, origLoc, newLoc, 15)
- puppetSprite(cursorSprite, 0)
- cursor(0)
- cursor(-1)
- go(the frame + 1)
- end
-
- on checkNewGame
- if the frame >= label("Screen Shots") then
- exit
- else
- if the frame >= label("Tangram 3.1") then
- setProp(29, 36, "puppet", 0)
- go("Tangram " & gUserLevel & ".1")
- else
- if the frame >= label("Tangram 2.1") then
- setProp(29, 36, "puppet", 0)
- go("Tangram " & gUserLevel & ".1")
- else
- if the frame >= label("Tangram 1.1") then
- setProp(29, 36, "puppet", 0)
- go("Tangram " & gUserLevel & ".1")
- else
- if the frame >= label("Ma Barker") then
- exit
- else
- if the frame >= label("Band 3.1") then
- setProp(17, 23, "puppet", 0)
- go("Band " & gUserLevel & ".1")
- else
- if the frame >= label("Band 3") then
- exit
- else
- if the frame >= label("Band 2.1") then
- setProp(17, 23, "puppet", 0)
- go("Band " & gUserLevel & ".1")
- else
- if the frame >= label("Band 2") then
- exit
- else
- if the frame >= label("Band 1.1") then
- setProp(17, 23, "puppet", 0)
- go("Band " & gUserLevel & ".1")
- else
- if the frame < label("Flags Up") then
- go("Flags Up")
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end
-
- on movePiece whichSprite, whichSprite1, whichSprite2, numberOfPieces, snapDistance, spriteOffset1, spriteOffset2, whichSound
- set userH to the mouseH
- set userV to the mouseV
- if the timer < 10 then
- exit
- end if
- set userH1 to userH
- set userV1 to userV
- set offsetH to userH - the locH of sprite whichSprite
- set offsetV to userV - the locV of sprite whichSprite
- set theForeColor to the foreColor of sprite whichSprite
- set activateScript to setActivateScript(whichSprite, whichSprite2)
- do(activateScript)
- set the foreColor of sprite whichSprite2 to theForeColor
- puppetSprite(whichSprite, 1)
- set the locV of sprite whichSprite to -500
- updateStage()
- repeat while the stillDown
- set userH to the mouseH
- set userV to the mouseV
- set origLoc to the loc of sprite whichSprite2
- set newLoc to point(userH - offsetH, userV - offsetV)
- slidePiece(whichSprite2, origLoc, newLoc, 3)
- end repeat
- playSound(whichSound)
- set gUserLevel to checkRange(gUserLevel, 1, 3)
- set numberOfPlaced to 0
- set numberOfMatches to 0
- set numberOfPieces to getAt(numberOfPieces, gUserLevel)
- set snapDistance to getAt(snapDistance, gUserLevel)
- set the loc of sprite whichSprite to the loc of sprite whichSprite2
- deactivate([whichSprite2])
- updateStage()
- if the frame >= label("Ma Barker") then
- repeat with x = 1 to numberOfPieces
- set whichSprite to x + spriteOffset1
- if the type of sprite whichSprite > 0 then
- set distanceH to abs(the locH of sprite whichSprite - the locH of sprite (whichSprite + spriteOffset2))
- set distanceV to abs(the locV of sprite whichSprite - the locV of sprite (whichSprite + spriteOffset2))
- if (distanceH = 0) and (distanceV = 0) then
- set numberOfMatches to numberOfMatches + 1
- next repeat
- end if
- if (distanceH <= snapDistance) and (distanceV <= snapDistance) then
- slidePiece(whichSprite, the loc of sprite whichSprite, the loc of sprite (whichSprite + spriteOffset2), 3)
- set numberOfMatches to numberOfMatches + 1
- end if
- end if
- end repeat
- if numberOfMatches >= numberOfPieces then
- go(marker(1))
- else
- go(the frame)
- end if
- startTimer()
- exit
- end if
- if the frame < label("Ma Barker") then
- set whichSprite0 to whichSprite1 - spriteOffset2
- repeat with x = whichSprite0 to whichSprite0 + numberOfPieces - 1
- repeat with whichSprite = whichSprite1 to whichSprite1 + numberOfPieces - 1
- if the type of sprite whichSprite > 0 then
- set distanceH to abs(the locH of sprite whichSprite - the locH of sprite x)
- set distanceV to abs(the locV of sprite whichSprite - the locV of sprite x)
- if (distanceH = 0) and (distanceV = 0) then
- set numberOfPlaced to numberOfPlaced + 1
- if whichSprite = (x + spriteOffset2) then
- set numberOfMatches to numberOfMatches + 1
- end if
- next repeat
- end if
- if (distanceH <= snapDistance) and (distanceV <= snapDistance) then
- slidePiece(x, the loc of sprite x, the loc of sprite whichSprite, 3)
- set numberOfPlaced to numberOfPlaced + 1
- if whichSprite = (x + spriteOffset2) then
- set numberOfMatches to numberOfMatches + 1
- end if
- end if
- end if
- end repeat
- end repeat
- if numberOfMatches >= numberOfPieces then
- playSound("Band Win")
- delayFor(10)
- go(marker(1))
- else
- if numberOfPlaced >= numberOfPieces then
- if (userH1 <> userH) or (userV1 <> userV) then
- playSound("Band Lose")
- delayFor(10)
- end if
- go(the frame)
- else
- go(the frame)
- end if
- end if
- startTimer()
- exit
- end if
- end
-
- on moveTangram whichSprite
- set numberOfPieces to [4, 4, 7]
- set snapDistance to [20, 15, 10]
- movePiece(whichSprite, 13, 37, numberOfPieces, snapDistance, 28, -16, 0)
- end
-
- on moveBand whichSprite
- set numberOfPieces to [3, 4, 5]
- set snapDistance to [15, 15, 15]
- set newSound to "!" & the name of cast the castNum of sprite whichSprite & " Band"
- movePiece(whichSprite, 10, 23, numberOfPieces, snapDistance, 16, -7, newSound)
- end
-
- on slidePiece whichSprite, origLoc, newLoc, numberOfSteps
- puppetSprite(whichSprite, 1)
- repeat with x = 1 to numberOfSteps
- set the loc of sprite whichSprite to newLoc - ((newLoc - origLoc) / x)
- updateStage()
- end repeat
- set the loc of sprite whichSprite to newLoc
- updateStage()
- end
-
- on scrollWaldo userH, userV, distance
- set newH to -1
- set newV to -1
- if userH < 10 then
- set newH to checkRange(the locH of sprite gBDropSprite + distance, 205, 307)
- else
- if userH > 502 then
- set newH to checkRange(the locH of sprite gBDropSprite - distance, 205, 307)
- end if
- end if
- if userV < 10 then
- set newV to checkRange(the locV of sprite gBDropSprite + distance, 98, 286)
- else
- if userV > 374 then
- set newV to checkRange(the locV of sprite gBDropSprite - distance, 98, 286)
- end if
- end if
- if newH > 0 then
- set oldH to the locH of sprite gBDropSprite
- set the locH of sprite gBDropSprite to newH
- repeat with x = 1 to 2
- set offsetH to oldH - the locH of sprite (gBDropSprite + x)
- set the locH of sprite (gBDropSprite + x) to newH - offsetH
- end repeat
- end if
- if newV > 0 then
- set oldV to the locV of sprite gBDropSprite
- set the locV of sprite gBDropSprite to newV
- repeat with x = 1 to 2
- set offsetV to oldV - the locV of sprite (gBDropSprite + x)
- set the locV of sprite (gBDropSprite + x) to newV - offsetV
- end repeat
- end if
- go(the frame)
- end
-
- on waldoWave
- set offsetH to the locH of sprite (gBDropSprite + 1)
- set offsetV to the locV of sprite (gBDropSprite + 1)
- activate(gBDropSprite + 2, "Waldo Arm", 1, 36, offsetH - 10, offsetV + 13, EMPTY, EMPTY, EMPTY)
- activate(gBDropSprite + 3, "Waldo Hand 1", 1, 36, offsetH - 12, offsetV - 2, EMPTY, EMPTY, EMPTY)
- set the backColor of sprite (gBDropSprite + 2) to 204
- set the backColor of sprite (gBDropSprite + 3) to 204
- updateStage()
- repeat with x = 1 to 3
- delayFor(5)
- set the castNum of sprite (gBDropSprite + 3) to the number of cast "Waldo Hand 2"
- set the loc of sprite (gBDropSprite + 3) to point(offsetH - 15, offsetV - 1)
- updateStage()
- delayFor(5)
- set the castNum of sprite (gBDropSprite + 3) to the number of cast "Waldo Hand 3"
- set the loc of sprite (gBDropSprite + 3) to point(offsetH - 15, offsetV - 1)
- updateStage()
- delayFor(5)
- set the castNum of sprite (gBDropSprite + 3) to the number of cast "Waldo Hand 2"
- set the loc of sprite (gBDropSprite + 3) to point(offsetH - 15, offsetV - 1)
- updateStage()
- delayFor(5)
- set the castNum of sprite (gBDropSprite + 3) to the number of cast "Waldo Hand 1"
- set the loc of sprite (gBDropSprite + 3) to point(offsetH - 12, offsetV - 2)
- updateStage()
- end repeat
- delayFor(5)
- deactivate([gBDropSprite + 2, gBDropSprite + 3])
- updateStage()
- end
-
- on gimmeaBalloon whichPos, whichFrame, whichBalloon, now
- set gBigBalloon to 0
- store([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40])
- if not listp(gBalloonsList) then
- set gBalloonsList to [0, 0, 0, 0]
- end if
- if whichPos <= count(gBalloonsList) then
- if (getAt(gBalloonsList, whichPos) = 0) or now then
- setAt(gBalloonsList, whichPos, 1)
- set gBalloons to checkRange(gBalloons + 1, 1, 4)
- if whichFrame < 1 then
- set gReturnFrame to the frame
- else
- set gReturnFrame to whichFrame
- end if
- if whichBalloon < 1 then
- setProp(1, 40, "puppet", 1)
- setProp(41, 48, "puppet", 0)
- go("Balloons" & gBalloons)
- else
- go(the frame)
- end if
- end if
- end if
- end
-
- on gimmeaBigBalloon whichPos, whichFrame, now
- if not (the commandDown) then
- set gBigBalloon to whichPos
- store([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40])
- if whichFrame < 1 then
- set gReturnFrame to the frame
- else
- set gReturnFrame to whichFrame
- end if
- setProp(1, 45, "puppet", 1)
- setProp(46, 48, "puppet", 0)
- go("big balloon")
- end if
- end
-
- on gimmeaBigBalloon2 whichPos, whichFrame, now
- store([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40])
- if not listp(gBalloonsList) then
- set gBalloonsList to [0, 0, 0, 0]
- end if
- if whichPos <= count(gBalloonsList) then
- if (getAt(gBalloonsList, whichPos) = 0) or now then
- if whichFrame < 1 then
- set gReturnFrame to the frame
- else
- set gReturnFrame to whichFrame
- end if
- setProp(1, 45, "puppet", 1)
- setProp(46, 48, "puppet", 0)
- go("big balloon")
- end if
- end if
- end
-
- on returnBalloon
- restore([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40])
- setProp(41, 48, "puppet", 1)
- go(gReturnFrame)
- end
-